/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
 * Copyright (c) 2009 INRIA
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation;
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * Author: Guillaume Seguin <guillaume@segu.in>
 */

#ifndef MULTI_THREADING_HELPER_H
#define MULTI_THREADING_HELPER_H

#include "ns3/node.h"
#include "ns3/ptr.h"
#include "ns3/multithreaded-simulator-impl.h"
#include <string>

namespace ns3 {

class MultiThreadedSimulatorImpl;

/**
 * \brief sets up, if required, a multithreaded simulator
 */
class MultiThreadingHelper
{
public:
  MultiThreadingHelper (void);

  /**
   * Enables multithreading
   */
  void Enable ();

  /**
   * If multithreading is enabled, create a MultiThreadingNodePartition for each
   * node of the network.
   */
  void Install (void) const;
  uint32_t AddSubPartition(uint32_t context, uint32_t subContext);

private:
  uint64_t GetMinDelay (Ptr<Node> node) const;
  bool m_enableMultiThreading;
  Ptr<MultiThreadedSimulatorImpl> m_simulator;

  //add
  //Time m_delay;
};

} // namespace ns3

#endif /* MULTI_THREADING_HELPER_H */
